﻿<%@ Page Title="Wiki" Language="C#" MasterPageFile="~/Pages/Site.Master" AutoEventWireup="true" CodeBehind="WikiPage.aspx.cs" Inherits="Altairis.FluffyCloud.WebCore.Pages.Sewen.WikiPage" %>
<asp:Content ContentPlaceHolderID="Main" runat="server">
    <div id="pagebox">
        <asp:FormView ID="PageFormView" runat="server" DataSourceID="PageObjectDataSource" RenderOuterTable="false">
            <EmptyDataTemplate>
                <h1 id="title">Stránka neexistuje</h1>
                <p>Taková stránka neexistuje.</p>
                <asp:LoginView runat="server">
                    <RoleGroups>
                        <asp:RoleGroup Roles="$Administrators">
                            <ContentTemplate>
                                <altairis:IconHyperLink runat="server" Icon="PageAdd" NavigateUrl="<%$ RouteUrl: RouteName=WikiPageNew %>" Text="Vytvořit novou stránku" />
                            </ContentTemplate>
                        </asp:RoleGroup>
                    </RoleGroups>
                </asp:LoginView>
            </EmptyDataTemplate>
            <ItemTemplate>
                <h1 id="title">
                    <asp:Literal runat="server" Text='<%# Eval("Title") %>' />
                </h1>
                <asp:LoginView runat="server">
                    <RoleGroups>
                        <asp:RoleGroup Roles="$Administrators">
                            <ContentTemplate>
                                <p class="small r">
                                    <asp:Literal runat="server" Text='<%# Eval("Version", "Verze: {0:d} {0:T} | ") %>' />
                                    <asp:Literal runat="server" Text='<%# Eval("UserName", "Uživatel: {0} | ") %>' />
                                    <asp:Literal runat="server" Text='<%# Eval("IpAddress", "IP: {0} | ") %>' />
                                    <asp:HyperLink runat="server" NavigateUrl="<%$ RouteUrl: RouteName=WikiPageHistory %>" Text="historie" />
                                    |
                                    <asp:HyperLink runat="server" NavigateUrl="<%$ RouteUrl: RouteName=WikiPageEdit %>" Text="editovat" />
                                    |
                                    <asp:HyperLink runat="server" NavigateUrl="<%$ RouteUrl: RouteName=WikiPageNew %>" Text="nová stránka" />
                                </p>
                            </ContentTemplate>
                        </asp:RoleGroup>
                    </RoleGroups>
                </asp:LoginView>
                <my:WikiMarkup runat="server" Text='<%# Eval("Body") %>' />
            </ItemTemplate>
        </asp:FormView>
        <asp:ObjectDataSource ID="PageObjectDataSource" runat="server" TypeName="Altairis.Sewen.PageStoreManager" DataObjectTypeName="Altairis.Sewen.SewenPage" SelectMethod="LoadPage">
            <SelectParameters>
                <asp:RouteParameter Name="name" RouteKey="slug" Type="String" DefaultValue="FAQ" />
                <asp:RouteParameter Name="versionString" RouteKey="version" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
    </div>
</asp:Content>